package com.stock.stock.modules.sys.controller;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import com.stock.stock.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.stock.stock.modules.sys.entity.StockListEntity;
import com.stock.stock.modules.sys.service.StockListService;

import javax.annotation.PostConstruct;


/**
 * ${comments}
 *
 * @author abc
 * @email 635177408@163.com
 * @date 2021-07-23 21:55:54
 */
@RestController
@RequestMapping("stock")
public class StockListController {
    @Autowired
    private StockListService stockListService;

    @PostMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        List<StockListEntity> listEntities = stockListService.queryPage(params);
        return R.ok().put("data", listEntities);
    }


    @PostMapping("/day")
    public R daylist(@RequestParam Map<String, Object> params){
        List<StockListEntity> listEntities = stockListService.getDay(params);
        return R.ok().put("data", listEntities);
    }

    @PostMapping("/time")
    public R timelist(@RequestParam Map<String, Object> params){
        List<StockListEntity> listEntities = stockListService.getTime(params);
        return R.ok().put("data", listEntities);
    }


}
